





2 ** 3 = 822 % 8 = 622 // 8 = 222 / 8 = 2.753 * 3 = 95 - 2 = 32 + 2 = 4-2, -1, 0, 1, 2, 3, 4, 5-1.25, -1.0, --0.5, 0.0, 0.5, 1.0, 1.25'a', 'aa', 'aaa', 'Hello!', '11 cats'+ operator for string concatenation. Prefer string formatting._) character._) are considered as "unuseful`._spam should not be used again in the code.==!=<><=>=== or != operator to evaluate boolean operation. Use the is or is not operators, or use implicit boolean evaluation.True and TrueTrueTrue and FalseFalseFalse and TrueFalseFalse and FalseFalseTrue or TrueTrueTrue or FalseTrueFalse or TrueTrueFalse or FalseFalsenot TrueFalsenot FalseTruebreak condition can occur in the loop:None with the == operator. Always use is.finally section is always executed, no matter if an exception has been raised or not, and even if an exception is not caught.spam += 1spam = spam + 1spam -= 1spam = spam - 1spam *= 1spam = spam * 1spam /= 1spam = spam / 1spam %= 1spam = spam % 1sorted to return a new list:setdefault we could write the same code more succinctly:A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also support mathematical operations like union, intersection, difference, and symmetric difference.
{} and the built-in function set(){} or you will get an empty dictionary instead.add() method we can add a single element to the set.update(), multiple ones .remove() will raise a key error if the value doesn't exist.discard() won't raise any errors.union() or | will create a new set that contains all the elements from the sets provided.intersection or & will return a set containing only the elements that are common to all of them.difference or - will return only the elements that are unique to the first set (invoked set).symetric_difference or ^ will return all the elements that are not common between them.The module standardizes a core set of fast, memory efficient tools that are useful by themselves or in combination. Together, they form an “iterator algebra” making it possible to construct specialized tools succinctly and efficiently in pure Python.
\'\"\t\n\\re package)dedent function from the textwrap standard package.upper() and lower():%x format specifier to convert an int value to a string:% operator.The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer formatted string literals or the str.format() interface helps avoid these errors. These alternatives also provide more powerful, flexible and extensible approaches to formatting text.
%s string formatting on functions that can do lazy parameters evaluation, the most common being logging:import re.re.compile() function. (Remember to use a raw string.)search() method. This returns a Match object.group() method to return a string of the actual matched text.?*+{n}{n,}{,m}{n,m}{n,m}? or *? or +?^spamspam$.\d, \w, and \s\D, \W, and \S[abc][^abc]os.path module and the other is the pathlib module. The pathlib module was added in Python 3.4, offering an object-oriented way to handle file system paths.\) as the separator between folder names. On Unix based operating system such as macOS, Linux, and BSDs, the forward slash (/) is used as the path separator. Joining paths can be a headache if your code needs to work on different platforms.os.path.join and pathlib.Path.joinpathos.path.join on Windows:pathlib on *nix:pathlib also provides a shortcut to joinpath using the / operator:os.path.join on Windows:pathlib on *nix:os on Windows:pathlib on *nix:os on Windows:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path and pathlibos.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on Windows:pathlib on *nix:os.listdir on Windows:pathlib on *nix:os.path.getsize() and os.listdir() together on Windows:pathlib on *nix:pathlib provides a lot more functionality than the ones listed above, like getting file name, getting file extension, reading/writing a file without manually opening it, etc. Check out the official documentation if you want to know more!with statement, which will close the file for you after you are done.pip install in your virtual environment.DEBUGlogging.debug()INFOlogging.info()WARNINGlogging.warning()ERRORlogging.error()CRITICALlogging.critical()args and kwargs are arbitrary - the important thing are the * and ** operators. They can mean:* means “pack all remaining positional arguments into a tuple named <name>”, while ** is the same for keyword arguments (except it uses a dictionary, not a tuple).* means “unpack tuple or list named <name> to positional arguments at this position”, while ** is the same for keyword arguments.*args when you have an indefinite amount of positional arguments.**kwargs when you have an indefinite number of keyword arguments.*args in the def statement.* operator.* operator with a generator may cause your program to run out of memory and crash.*args can introduce hard-to-find bugs.contextlib.contextmanager decorator:__main__ Top-level script environment__main__ is the name of the scope in which top-level code executes. A module’s name is set equal to __main__ when read from standard input, a script, or from an interactive prompt.__name__, which allows a common idiom for conditionally executing code in a module when it is run as a script or with python -m but not when it is imported:__name__ defined and if this is __main__, it implies that the module is being run standalone by the user and we can do corresponding appropriate actions.__name__ == “main”: is used to execute some code only if the file was run directly, and not imported.setup.py file is at the heart of a Python project. It describes all of the metadata about your project. There a quite a few fields you can add to a project to give it a rich set of metadata describing the project. However, there are only three required fields: name, version, and packages. The name field must be unique if you wish to publish your package on the Python Package Index (PyPI). The version field keeps track of different releases of the project. The packages field describes where you’ve put the Python source code within your project.Dataclasses are python classes but are suited for storing data objects. This module provides a decorator and functions for automatically adding generated special methods such as __init__() and __repr__() to user-defined classes.typing.Any.Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. Windows is a first-class citizen, in our world.
Where packages, notebooks, projects and environments are shared. Your place for free public conda package hosting.
Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.
2 ** 3 = 822 % 8 = 622 // 8 = 222 / 8 = 2.753 * 3 = 95 - 2 = 32 + 2 = 4-2, -1, 0, 1, 2, 3, 4, 5-1.25, -1.0, --0.5, 0.0, 0.5, 1.0, 1.25'a', 'aa', 'aaa', 'Hello!', '11 cats'+ operator for string concatenation. Prefer string formatting._) character._) are considered as "unuseful`._spam should not be used again in the code.==!=<><=>=== or != operator to evaluate boolean operation. Use the is or is not operators, or use implicit boolean evaluation.True and TrueTrueTrue and FalseFalseFalse and TrueFalseFalse and FalseFalseTrue or TrueTrueTrue or FalseTrueFalse or TrueTrueFalse or FalseFalsenot TrueFalsenot FalseTruebreak condition can occur in the loop:None with the == operator. Always use is.finally section is always executed, no matter if an exception has been raised or not, and even if an exception is not caught.spam += 1spam = spam + 1spam -= 1spam = spam - 1spam *= 1spam = spam * 1spam /= 1spam = spam / 1spam %= 1spam = spam % 1sorted to return a new list:setdefault we could write the same code more succinctly:A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also support mathematical operations like union, intersection, difference, and symmetric difference.
{} and the built-in function set(){} or you will get an empty dictionary instead.add() method we can add a single element to the set.update(), multiple ones .remove() will raise a key error if the value doesn't exist.discard() won't raise any errors.union() or | will create a new set that contains all the elements from the sets provided.intersection or & will return a set containing only the elements that are common to all of them.difference or - will return only the elements that are unique to the first set (invoked set).symetric_difference or ^ will return all the elements that are not common between them.The module standardizes a core set of fast, memory efficient tools that are useful by themselves or in combination. Together, they form an “iterator algebra” making it possible to construct specialized tools succinctly and efficiently in pure Python.
\'\"\t\n\\re package)dedent function from the textwrap standard package.upper() and lower():%x format specifier to convert an int value to a string:% operator.The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer formatted string literals or the str.format() interface helps avoid these errors. These alternatives also provide more powerful, flexible and extensible approaches to formatting text.
%s string formatting on functions that can do lazy parameters evaluation, the most common being logging:import re.re.compile() function. (Remember to use a raw string.)search() method. This returns a Match object.group() method to return a string of the actual matched text.?*+{n}{n,}{,m}{n,m}{n,m}? or *? or +?^spamspam$.\d, \w, and \s\D, \W, and \S[abc][^abc]os.path module and the other is the pathlib module. The pathlib module was added in Python 3.4, offering an object-oriented way to handle file system paths.\) as the separator between folder names. On Unix based operating system such as macOS, Linux, and BSDs, the forward slash (/) is used as the path separator. Joining paths can be a headache if your code needs to work on different platforms.os.path.join and pathlib.Path.joinpathos.path.join on Windows:pathlib on *nix:pathlib also provides a shortcut to joinpath using the / operator:os.path.join on Windows:pathlib on *nix:os on Windows:pathlib on *nix:os on Windows:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path and pathlibos.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on *nix:pathlib on *nix:os.path on Windows:pathlib on *nix:os.listdir on Windows:pathlib on *nix:os.path.getsize() and os.listdir() together on Windows:pathlib on *nix:pathlib provides a lot more functionality than the ones listed above, like getting file name, getting file extension, reading/writing a file without manually opening it, etc. Check out the official documentation if you want to know more!with statement, which will close the file for you after you are done.pip install in your virtual environment.DEBUGlogging.debug()INFOlogging.info()WARNINGlogging.warning()ERRORlogging.error()CRITICALlogging.critical()args and kwargs are arbitrary - the important thing are the * and ** operators. They can mean:* means “pack all remaining positional arguments into a tuple named <name>”, while ** is the same for keyword arguments (except it uses a dictionary, not a tuple).* means “unpack tuple or list named <name> to positional arguments at this position”, while ** is the same for keyword arguments.*args when you have an indefinite amount of positional arguments.**kwargs when you have an indefinite number of keyword arguments.*args in the def statement.* operator.* operator with a generator may cause your program to run out of memory and crash.*args can introduce hard-to-find bugs.contextlib.contextmanager decorator:__main__ Top-level script environment__main__ is the name of the scope in which top-level code executes. A module’s name is set equal to __main__ when read from standard input, a script, or from an interactive prompt.__name__, which allows a common idiom for conditionally executing code in a module when it is run as a script or with python -m but not when it is imported:__name__ defined and if this is __main__, it implies that the module is being run standalone by the user and we can do corresponding appropriate actions.__name__ == “main”: is used to execute some code only if the file was run directly, and not imported.setup.py file is at the heart of a Python project. It describes all of the metadata about your project. There a quite a few fields you can add to a project to give it a rich set of metadata describing the project. However, there are only three required fields: name, version, and packages. The name field must be unique if you wish to publish your package on the Python Package Index (PyPI). The version field keeps track of different releases of the project. The packages field describes where you’ve put the Python source code within your project.Dataclasses are python classes but are suited for storing data objects. This module provides a decorator and functions for automatically adding generated special methods such as __init__() and __repr__() to user-defined classes.typing.Any.Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. Windows is a first-class citizen, in our world.
Where packages, notebooks, projects and environments are shared. Your place for free public conda package hosting.